#include "src/parser/sql_parser.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

const char* debug_tests[] = {
    "CREATE TABLE test (id INT);",                    // Basic
    "CREATE TABLE test (id INT NOT NULL);",           // NOT NULL
    "CREATE TABLE test (id INT PRIMARY KEY);",        // PRIMARY KEY 
    "CREATE TABLE test (id INT DEFAULT 1);",          // DEFAULT only
    "CREATE TABLE test (id INT DEFAULT 1, name VARCHAR(50));",  // DEFAULT with comma
    NULL
};

int main() {
    printf("=== DEBUG DEFAULT Parsing ===\n\n");
    
    for (int i = 0; debug_tests[i] != NULL; i++) {
        printf("%d. Testing: %s\n", i + 1, debug_tests[i]);
        
        parser_t* parser = parser_create(debug_tests[i]);
        if (!parser) {
            printf("   ❌ Failed to create parser\n");
            continue;
        }
        
        statement_t* stmt = parser_parse_statement(parser);
        if (!stmt) {
            printf("   ❌ Parse failed: %s\n", 
                   parser_get_error(parser) ? parser_get_error(parser) : "Unknown error");
        } else {
            printf("   ✅ Successfully parsed\n");
            statement_destroy(stmt);
        }
        
        parser_destroy(parser);
        printf("\n");
    }
    
    return 0;
}